package com.gocoolmall.member.config;

import com.gocoolmall.member.interceptor.LoginUserInterceptorRegistry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器的设置
 */
public class MemberWebConfig  implements WebMvcConfigurer {
    @Autowired
    LoginUserInterceptorRegistry  loginUserInterceptorRegistry;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginUserInterceptorRegistry).addPathPatterns("/**");//拦截器路径

    }
}
